# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=taglib
pkgver=1.11.1
pkgrel=3
pkgdesc="Library for reading and editing metadata of several popular audio formats"
url="http://taglib.github.io/"
arch="all"
options="!check"  # No test suite.
license="LGPL-2.1-only or MPL-1.1"
makedepends="zlib-dev cmake"
subpackages="$pkgname-dev"
source="https://taglib.github.io/releases/taglib-$pkgver.tar.gz
	CVE-2017-12678.patch
	CVE-2018-11439.patch
	"

# secfixes:
#   1.11.1-r2:
#     - CVE-2017-12678
#     - CVE-2018-11439

build() {
	cmake -DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DWITH_ASF=ON \
		-DWITH_MP4=ON \
		-DBUILD_SHARED_LIBS=ON
	make VERBOSE=1
}

package() {
	make DESTDIR="$pkgdir" install
}
sha512sums="7846775c4954ea948fe4383e514ba7c11f55d038ee06b6ea5a0a1c1069044b348026e76b27aa4ba1c71539aa8143e1401fab39184cc6e915ba0ae2c06133cb98  taglib-1.11.1.tar.gz
b5ac8fda91d33236951dae89b736219529dce5d521876f89b6ab8a57953c69d3a43861be035740108e4ecbb6a97146129449a9bc560118abdc3464bcd785f8ad  CVE-2017-12678.patch
9a118f9410404996bf3879325f77fcfb638f6cc71b4e258d9786bd741c2c45f26385a6049788ef6ebc56c7c987bd7ef6267a461f4478f5d52d236b035287cdf2  CVE-2018-11439.patch"
